import Vue from 'vue'
import Vuex from 'vuex'
import createPersistedState from "vuex-persistedstate"
Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    titleItems: [],
    firstBranch: '',
    secondBranch: ''
  },
  getters: {  // 以最后一次更改todos的数据为准
    
  },
  mutations: {  // 同步
    getTitle(state, param) {
      state.titleItems = param
      // console.log(param);
    },
    getFirst(state, param) {
      state.firstBranch = param
    },
    getSecond(state, param) {
      // console.log(param);
      state.secondBranch = param
    },
  },
  actions: {   // 异步
  },
  modules: {
  },
  plugins: [createPersistedState()],
})
